package empleados.ventana.componentes.interfaz;

import javax.swing.table.DefaultTableModel;

public class TablaEditableModelo extends DefaultTableModel{

    private boolean isEditable[][];
    private Object[] columnNames;
    private Object[][] data;

    public TablaEditableModelo(){
        
    }

    public void dibujarTabla(Object[][] data){
        this.data = data;
    }

    public boolean[][] getEditable(){
        return isEditable;
    }

    public void setCeldaEditable(int fila, int columna, boolean valor){
        isEditable[fila][columna] = valor;
    }

    public void setIsEditable(int filas, boolean columnasEditables[]){
        isEditable = new boolean[filas][columnasEditables.length];
        for(int i = 0; i < filas; i++) for(int j = 0; j < columnasEditables.length; j++) isEditable[i][j] = columnasEditables[j];
    }

    @Override
    public boolean isCellEditable(int row,int column){
        return isEditable[row][column];
    }

}